package com.example.whatrubbish.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexController {

    @Value("${app.version:1.0}")
    String version;

    /**
     * 本地访问内容地址 ：http://localhost:8080/
     * @return
     */
    @GetMapping("/")
    public String helloHtml() {
        return "index";
    }

    @ResponseBody
    @GetMapping("/version")
    public String getVersion() {
        return version;
    }
}